﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using PlayDeezGames.Common;

namespace DungeonDelver.Content
{
    public class Directions:DirectionsBase
    {
        private static int[] values = new int[] { 0, 1, 2, 3 };
        private static int[] deltaX = new int[] { 0, 1, 0, -1 };
        private static int[] deltaY = new int[] { -1, 0, 1, 0 };

        public override int Count
        {
            get { return values.Length; }
        }

        public override int Opposite(int direction)
        {
            return (direction + Count / 2) % Count;
        }

        public override int GetNext(int direction)
        {
            return (direction + 1) % Count;
        }

        public override int GetPrevious(int direction)
        {
            return (direction + Count - 1) % Count;
        }

        public override int GetNextColumn(int startColumn, int startRow, int direction)
        {
            return startColumn + deltaX[direction % Count];
        }

        public override int GetNextRow(int startColumn, int startRow, int direction)
        {
            return startRow + deltaY[direction % Count];
        }

        public override int[] Values
        {
            get
            {
                return values;
            }
        }
    }
}
